$.ajaxPrefilter(function (options) {
    if (options.url.indexOf('http') === -1) {
        options.url = 'http://api-breakingnews-web.itheima.net' + options.url

        if (options.url.indexOf('/my/') !== -1) {
            options.headers = {
                Authorization: localStorage.getItem('token')
            }
        }
        options.complete = function (res) {
            if (res.responseJSON.message === '身份认证失败！') {
                //1.清空 localStorage
                localStorage.clear()
                //1.2  跳转到登录页面
                location.href = 'login.html'
            }
        }

    }

})